<template>
  <div class="select-item">
    <div class="select-content">
      <span>{{item.name}}</span>
      <span>{{item.shapeType == 'circle'? '圆形' : '多边形'}}</span>
      <span>{{item.remark}}</span>
    </div>
    <div class="select-bar">
      <a-button @click="handleView" type="link">查看</a-button>
      <a-button @click="handleSelect" type="link">选择</a-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'SelectItem',
  props:{
    item: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {};
  },
  methods: {
    handleView(){
      this.$emit("view", this.item);
    },
    handleSelect(){
      console.log('select----------:')
      this.$emit("select", this.item);
    }
  }
}
</script>

<style lang="less" scoped>
.select-item{
  width: calc(33.33% - 10px);
  height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  &:hover{
    background-color: #f5f5f5;
  }
  .select-content{
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .select-bar{
    height: 30px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
  }
}
</style>